void __attribute__((naked,noinline)) sub_FFC5D784_my(){
asm volatile(
                "LDR     R12, =0x201E\n"
                "STMFD   SP!, {R4,LR}\n"
                "CMP     R0, R12\n"
                "BEQ     loc_FFC5D844\n"
                "BGT     loc_FFC5D7E0\n"
                "LDR     R12, =0x2004\n"
                "CMP     R0, R12\n"
                "BEQ     loc_FFC5D84C\n"
                "BGT     loc_FFC5D7C8\n"
                "SUB     R12, R0, #0x1000\n"
                "SUBS    R12, R12, #0xA9\n"
                "SUBNE   R12, R0, #0x1000\n"
                "SUBNES  R12, R12, #0xAD\n"
                "SUBNE   R12, R0, #0x1000\n"
                "SUBNES  R12, R12, #0xAF\n"
                "BNE     loc_FFC5D85C\n"
                "B       loc_FFC5D844\n"
"loc_FFC5D7C8:\n"
                "SUB     R12, R0, #0x2000\n"
                "SUBS    R12, R12, #5\n"
                "SUBNE   R12, R0, #0x2000\n"
                "SUBNES  R12, R12, #0x1D\n"
                "BNE     loc_FFC5D85C\n"
                "B       loc_FFC5D844\n"
"loc_FFC5D7E0:\n"
                "LDR     R12, =0x5004\n"
                "CMP     R0, R12\n"
                "BEQ     loc_FFC5D844\n"
                "BGT     loc_FFC5D80C\n"
                "SUB     R12, R0, #0x3000\n"
                "SUBS    R12, R12, #0xA\n"
                "BEQ     loc_FFC5D840\n"
                "SUB     R12, R0, #0x5000\n"
                "SUBS    R12, R12, #1\n"
                "BNE     loc_FFC5D85C\n"
                "B       loc_FFC5D844\n"
"loc_FFC5D80C:\n"
                "SUB     R12, R0, #0x5000\n"
                "SUBS    R12, R12, #6\n"
                "BEQ     loc_FFC5D844\n"
                "SUB     R12, R0, #0x5000\n"
                "SUBS    R12, R12, #7\n"
                "BNE     loc_FFC5D85C\n"
                "BL      sub_FFC1A5F4\n"
                "LDR     R1, =0x5760\n"
                "LDR     R0, [R1,#0x10]\n"
                "CMP     R0, #7\n"
                "LDREQ   R0, [R1,#0x18]\n"
                "BLEQ    sub_FFC5E0F4\n"
                "B       loc_FFC5D854\n"
"loc_FFC5D840:\n"
                "BL      sub_FFC19B88\n"
"loc_FFC5D844:\n"
                "LDMFD   SP!, {R4,LR}\n"
                "B       sub_FFC5D5E4_my\n" //------------->
"loc_FFC5D84C:\n"
                "BL      sub_FFC5C674\n"
                "BL      sub_FFC5D098\n"
"loc_FFC5D854:\n"
                "MOV     R0, #0\n"
                "LDMFD   SP!, {R4,PC}\n"
"loc_FFC5D85C:\n"
                "MOV     R0, #1\n"
                "LDMFD   SP!, {R4,PC}\n"
 );
}

void __attribute__((naked,noinline)) sub_FFC5D5E4_my(){
asm volatile(
                "STMFD   SP!, {R4-R6,LR}\n"
                "BL      sub_FFC5E260\n"
                "CMP     R0, #1\n"
                "BLEQ    sub_FFC5E348\n"
                "LDR     R4, =0x5760\n"
                "MOV     R5, #1\n"
                "LDR     R0, [R4,#0x24]\n"
                "CMP     R0, #0\n"
                "LDRNE   R0, [R4,#0x4C]\n"
                "CMPNE   R0, #0\n"
                "BEQ     loc_FFC5D650\n"
                "BL      sub_FFC5E260\n"
                "CMP     R0, #1\n"
                "BNE     loc_FFC5D650\n"
                "BL      sub_FFC5E348\n"
                "LDR     R0, [R4,#0x78]\n"
                "CMP     R0, #0\n"
                "BNE     loc_FFC5D650\n"
                "LDR     R1, =0xFFC5D764\n"
                "MOV     R0, #0x20\n"
                "BL      sub_FFC542D8\n"
                "BL      sub_FFD66ECC\n"
                "BL      sub_FFD66E5C\n"
                "MOV     R1, #0\n"
                "MOV     R0, #0x51\n"
                "BL      sub_FFC659B4\n"
                "STR     R5, [R4,#0x78]\n"
"loc_FFC5D650:\n"
                "BL      sub_FFC5E260\n"
                "CMP     R0, #1\n"
                "BNE     loc_FFC5D69C\n"
                "LDR     R0, [R4,#0x44]\n"
                "CMP     R0, #0\n"
                "BEQ     loc_FFC5D69C\n"
                "LDR     R0, [R4,#0x74]\n"
                "CMP     R0, #0\n"
                "BNE     loc_FFC5D69C\n"
                "LDR     R1, =0xFFC5D778\n"
                "MOV     R0, #0x20\n"
                "BL      sub_FFC542D8\n"
                "MOV     R1, #0\n"
                "MOV     R0, #0x8C\n"
                "BL      sub_FFC659B4\n"
                "BL      sub_FFC63BA0\n"
                "MOV     R0, #0x21\n"
                "BL      sub_FFC659F4\n"
                "STR     R5, [R4,#0x74]\n"
"loc_FFC5D69C:\n"
                "LDR     R0, [R4,#0x38]\n"
                "CMP     R0, #0\n"
                "LDRNE   R0, [R4,#0x3C]\n"
                "CMPNE   R0, #0\n"
                "LDRNE   R0, [R4,#0x44]\n"
                "CMPNE   R0, #0\n"
                "LDRNE   R0, [R4,#0x48]\n"
                "CMPNE   R0, #0\n"
                "LDRNE   R0, [R4,#0x1C]\n"
                "LDRNE   R1, [R4,#0x20]\n"
                "ORRNES  R0, R0, R1\n"
                "BEQ     loc_FFC5D6D8\n"
                "BL      sub_FFC5CF38\n"
                "BL      sub_FFC5D098\n"
                "B       loc_FFC5D700\n"
"loc_FFC5D6D8:\n"
                "LDR     R0, [R4,#0x58]\n"
                "CMP     R0, #0\n"
                "BEQ     loc_FFC5D708\n"
                "BL      sub_FFC5CF80\n"
                "CMP     R0, #1\n"
                "BNE     loc_FFC5D708\n"
                "BL      sub_FFC5F924\n"
                "BL      sub_FFC5F8E0\n"
                "MOV     R0, #0\n"
                "BL      sub_FFC5E130\n"
"loc_FFC5D700:\n"
                "MOV     R0, #0\n"
                "LDMFD   SP!, {R4-R6,PC}\n"
"loc_FFC5D708:\n"
                "BL      sub_FFC5CF80\n"
                "CMP     R0, #1\n"
                "BNE     loc_FFC5D730\n"
                "LDR     R0, [R4,#0x7C]\n"
                "CMP     R0, #0\n"
                "BLEQ    sub_FFC5E38C_my\n"  //------>
                "MOV     R0, #0\n"
                "STR     R0, [R4,#0x70]\n"
                "STR     R0, [R4,#0x74]\n"
                "STR     R0, [R4,#0x78]\n"
"loc_FFC5D730:\n"
                "MOV     R0, #1\n"
                "LDMFD   SP!, {R4-R6,PC}\n"
);
}

void __attribute__((naked,noinline)) sub_FFC5E38C_my(){ 
 asm volatile(
                "STMFD   SP!, {R4,LR}\n"
                "LDR     R1, =0xFFC5E5AC\n"
                "MOV     R0, #0x20\n"
                "BL      sub_FFC542D8\n"
                "BL      sub_FFC19DA4\n"
                "BL      sub_FFC5E6B0\n"
                "BL      sub_FFC619A8_my\n"  //------>
                "MOV     R0, #1\n"
                "BL      sub_FFC5CA14\n"
                "BL      sub_FFC5CEBC\n"
                "LDMFD   SP!, {R4,LR}\n"
                "B       sub_FFC5D12C\n"
 );
} 

void __attribute__((naked,noinline)) sub_FFC619A8_my(){ 
 asm volatile(
                "STMFD   SP!, {R4-R6,LR}\n"
                "LDR     R1, =0xFFC61BB4\n"
                "MOV     R0, #0x20\n"
                "BL      sub_FFC542D8\n"
                "LDR     R4, =0x59E8\n"
                "MOV     R0, #6\n"
                "MOV     R5, #1\n"
                "STR     R0, [R4,#0x5C]\n"
                "STR     R5, [R4,#0x10]\n"
                "BL      sub_FFD2A7D8\n"
                "BL      sub_FFD30690\n"
                "BL      sub_FFD2EE78\n"
                "BL      sub_FFC61DC8_my\n"  //------>
                "BL      sub_FFD37F94\n"
                "MOV     R0, #1\n"
                "STR     R5, [R4,#0x18]\n"
                "BL      sub_FFC61E60\n"
                "MOV     R0, #3\n"
                "STR     R0, [R4,#0x60]\n"
                "LDR     R1, [R4,#0x64]\n"
                "LDMFD   SP!, {R4-R6,LR}\n"
                "MOV     R0, #0\n"
                "BX      R1\n"
 );
} 

void __attribute__((naked,noinline)) sub_FFC61DC8_my(){ 
 asm volatile(
                "STMFD   SP!, {R4,LR}\n"
                "LDR     R0, =0x855\n"
                "BL      sub_FFD27034\n"
                "BL      sub_FFC19B88\n"
				"BL      sub_FFC61764\n"
                "BL      sub_FFC61764_my\n"  //------>
                "BL      sub_FFD2A0E8\n"
                "BL      sub_FFD1A730\n"
                "BL      sub_FFD324BC\n"
                "BL      sub_FFD328AC\n"
                "BL      sub_FFD32AC4\n"
                "BL      sub_FFD32634\n"
                "BL      sub_FFD30DCC\n"
                "BL      sub_FFC65A94\n"
                "LDMFD   SP!, {R4,LR}\n"
                "B       sub_FFC658C4\n"
 );
} 

// branches are together

void __attribute__((naked,noinline)) sub_FFC61764_my(){ 
 asm volatile(
                "STMFD   SP!, {R4,LR}\n"
                "LDR     R0, =0x5A50\n"
                "ADR     R1, sub_FFC61534_my\n"  //------>
                "BL      sub_FFC66248\n"
                "LDR     R1, =0x59E8\n"
                "ADR     R0, sub_FFC61658_my\n"  //------>
                "STR     R0, [R1,#0x64]\n"
                "LDMFD   SP!, {R4,PC}\n"
 );
} 

//branch 1

void __attribute__((naked,noinline)) sub_FFC61534_my(){ 
 asm volatile(
                "STMFD   SP!, {R3-R5,LR}\n"
                "LDR     R4, =0x59E8\n"
                "LDR     R0, [R4,#0x3C]\n"
                "CMP     R0, #0\n"
                "BLEQ    sub_FFD1948C\n"
                "LDR     R0, [R4,#0x30]\n"
                "CMP     R0, #1\n"
                "BNE     loc_FFC61574\n"
                "LDR     R1, =0xFFC61638\n"
                "MOV     R0, #0x20\n"
                "BL      sub_FFC542D8\n"
                "MOV     R0, #0\n"
                "STR     R0, [R4,#0x30]\n"
                "STR     R0, [R4,#0x2C]\n"
                "BL      sub_FFC61444\n"
                "LDMFD   SP!, {R3-R5,PC}\n"
"loc_FFC61574:\n"
                "BL      sub_FFC15500\n"
                "LDRH    R0, [R4,#4]\n"
                "MOV     R1, SP\n"
                "STRH    R0, [SP,#0x10-0x10]\n"
                "LDR     R0, [R4,#0x5C]\n"
                "STRH    R0, [SP,#0x10-0xE]\n"
                "MOV     R0, #0x40\n"
                "BL      sub_FFC659B4\n"
                "LDR     R0, [R4,#0x1C]\n"
                "CMP     R0, #0\n"
                "LDREQH  R0, [R4,#4]\n"
                "BLEQ    sub_FFC5BD90\n"
                "LDRH    R0, [R4,#4]\n"
                "MOV     R1, #1\n"
                "BL      sub_FFC60854_my\n"  //------>
                "LDR     R0, [R4,#0x60]\n"
                "BL      sub_FFC61E60\n"
                "MOV     R0, #3\n"
                "STR     R0, [R4,#0x60]\n"
                "LDR     R1, [R4,#0x64]\n"
                "ADD     SP, SP, #4\n"
                "LDMFD   SP!, {R4,R5,LR}\n"
                "MOV     R0, #0\n"
                "BX      R1\n"
 );
} 

//branch 2

void __attribute__((naked,noinline)) sub_FFC61658_my(){ 
 asm volatile(
                "STMFD   SP!, {R4-R6,LR}\n"
                "LDR     R0, =0x8009\n"
                "BL      sub_FFC5BEB8\n"
                "LDR     R4, =0x826\n"
                "CMP     R0, #0xB\n"
                "CMPNE   R0, #0xC\n"
                "MOV     R0, R4\n"
                "BNE     loc_FFC61680\n"
                "BL      sub_FFD26EFC\n"
                "B       loc_FFC61690\n"
"loc_FFC61680:\n"
                "BL      sub_FFD2713C\n"
                "CMP     R0, #0\n"
                "MOVNE   R0, R4\n"
                "BLNE    sub_FFD27034\n"
"loc_FFC61690:\n"
                "LDR     R4, =0x59E8\n"
                "LDRH    R0, [R4,#4]\n"
                "BL      sub_FFD308C8\n"
                "BL      sub_FFD2F038\n"
                "BL      sub_FFD32B54\n"
                //"BL      nullsub_102\n"
                "BL      sub_FFD30F58\n"
                "BL      sub_FFD1C480\n"
                "MOV     R5, #0\n"
                "MOV     R0, R5\n"
                "STR     R5, [R4,#0x24]\n"
                "BL      sub_FFC155E4\n"
                "BL      sub_FFD1BB80\n"
                "STR     R5, [R4,#0x3C]\n"
                "LDRH    R0, [R4,#4]\n"
                "MOV     R1, #0\n"
                "BL      sub_FFC60854_my\n"    //------>
                "BL      sub_FFC63BA0\n"
                "LDR     R1, [R4,#0x5C]\n"
                "MOV     R0, #0x41\n"
                "BL      sub_FFC659B4\n"
                "BL      sub_FFD2F028\n"
                "BL      sub_FFD2A94C\n"
                "CMP     R0, #0\n"
                "BLEQ    sub_FFD2F03C\n"
                "BL      sub_FFD30850\n"
                "BL      sub_FFD192FC\n"
                "BL      sub_FFC5A1A0\n"
                "STR     R0, [R4,#0x58]\n"
                "LDR     R0, =0x8003\n"
                "STR     R5, [R4,#0x2C]\n"
                "BL      sub_FFC5BEB8\n"
                "STRH    R0, [R4]\n"
                "LDR     R0, =0x313D\n"
                "MOV     R1, #0\n"
                "BL      sub_FFC5AC24\n"
                "BL      sub_FFC61D64\n"
                "LDR     R0, [R4,#0x30]\n"
                "CMP     R0, #1\n"
                "STREQ   R5, [R4,#0x30]\n"
                "LDMEQFD SP!, {R4-R6,LR}\n"
                "BEQ     sub_FFC61444\n"
                "LDMFD   SP!, {R4-R6,PC}\n"
 );
} 

//branches are joining here

void __attribute__((naked,noinline)) sub_FFC60854_my(){ 
 asm volatile(
                "STMFD   SP!, {R4-R6,LR}\n"
                "MOV     R5, R1\n"
                "MOV     R4, R0\n"
                "MOV     R0, #0x60\n"
                "LDR     R1, =0xFFC60B24\n"
                "BL      sub_FFC542D8\n"
                "LDR     R6, =0x59E8\n"
                "LDR     R0, [R6,#0x10]\n"
                "CMP     R0, #0\n"
                "BEQ     loc_FFC60980\n"
                "LDR     R0, [R6,#0x18]\n"
                "LDR     R2, =0x820A\n"
                "LDR     R1, =0xFFFE0000\n"
                "CMP     R0, #1\n"
                "BNE     loc_FFC608C8\n"
                "CMP     R5, #1\n"
                "LDMEQFD SP!, {R4-R6,PC}\n"
                "CMP     R5, #0\n"
                "BNE     loc_FFC608C8\n"
                "CMP     R4, R2\n"
                "BEQ     loc_FFC608C0\n"
                "CMP     R1, R4,LSL#17\n"
                "TSTNE   R4, #0xC00\n"
                "BEQ     loc_FFC608BC\n"
                "BL      sub_FFC61C4C_my\n"  //------>
                "B       loc_FFC608C0\n"
"loc_FFC608BC:\n"
                "BL      sub_FFC61C00\n"
"loc_FFC608C0:\n"
                "BL      sub_FFC61DC4\n"
                "B       loc_FFC60980\n"
"loc_FFC608C8:\n"
                "CMP     R4, R2\n"
                "BEQ     loc_FFC60978\n"
                "CMP     R1, R4,LSL#17\n"
                "LDRH    R0, [R6,#2]\n"
                "TSTNE   R4, #0xC00\n"
                "BEQ     loc_FFC60928\n"
                "CMP     R0, R2\n"
                "BEQ     loc_FFC60978\n"
                "CMP     R1, R0,LSL#17\n"
                "TSTNE   R0, #0xC00\n"
                "BEQ     loc_FFC6090C\n"
                "LDR     R1, =0xFFC60B44\n"
                "MOV     R0, #0x60\n"
                "BL      sub_FFC542D8\n"
                "CMP     R5, #1\n"
                "BEQ     loc_FFC60950\n"
                "B       loc_FFC60920\n"
"loc_FFC6090C:\n"
                "LDR     R1, =0xFFC60B54\n"
                "MOV     R0, #0x60\n"
                "BL      sub_FFC542D8\n"
                "CMP     R5, #1\n"
                "BEQ     loc_FFC6096C\n"
"loc_FFC60920:\n"
                "BL      sub_FFC61C4C_my\n"  //------>
                "B       loc_FFC60978\n"
"loc_FFC60928:\n"
                "CMP     R0, R2\n"
                "BEQ     loc_FFC60978\n"
                "CMP     R1, R0,LSL#17\n"
                "TSTNE   R0, #0xC00\n"
                "BEQ     loc_FFC60958\n"
                "LDR     R1, =0xFFC60B64\n"
                "MOV     R0, #0x60\n"
                "BL      sub_FFC542D8\n"
                "CMP     R5, #1\n"
                "BNE     loc_FFC60974\n"
"loc_FFC60950:\n"
                "LDMFD   SP!, {R4-R6,LR}\n"
                "B       sub_FFC61C78\n"
"loc_FFC60958:\n"
                "LDR     R1, =0xFFC60B74\n"
                "MOV     R0, #0x60\n"
                "BL      sub_FFC542D8\n"
                "CMP     R5, #1\n"
                "BNE     loc_FFC60974\n"
"loc_FFC6096C:\n"
                "LDMFD   SP!, {R4-R6,LR}\n"
                "B       sub_FFC61C28\n"
"loc_FFC60974:\n"
                "BL      sub_FFC61C00\n"
"loc_FFC60978:\n"
                "CMP     R5, #0\n"
                "LDMNEFD SP!, {R4-R6,PC}\n"
"loc_FFC60980:\n"
                "STRH    R4, [R6,#2]\n"
                "LDMFD   SP!, {R4-R6,PC}\n"
 );
}

void __attribute__((naked,noinline)) sub_FFC61C4C_my(){ 
 asm volatile(
                "STMFD   SP!, {R4,LR}\n"
                "LDR     R1, =0xFFC61DA4\n"
                "MOV     R0, #0x20\n"
                "BL      sub_FFC542D8\n"
                "LDR     R0, =0x59E8\n"
                "LDR     R0, [R0,#0x28]\n"
                "CMP     R0, #0\n"
                "BLNE    sub_FFC626DC\n"
                "LDMFD   SP!, {R4,LR}\n"
                "MOV     R0, #0\n"
                "B       sub_FFC64BF4_my\n"  //----------->
 );
} 

void __attribute__((naked,noinline)) sub_FFC64BF4_my(){ 
 asm volatile(
                "STMFD   SP!, {R4,LR}\n"
                "LDR     R4, =0x5B9C\n"
                "MOV     R0, #0\n"
                "STR     R0, [R4,#0x30]\n"
                "LDR     R0, [R4,#8]\n"
                "CMP     R0, #0\n"
                "BNE     loc_FFC64C20\n"
                "LDR     R0, =sub_FFC64768_my\n"  //------>
                "MOV     R1, #0\n"
                "BL      sub_FFC5A41C\n"
                "STR     R0, [R4,#8]\n"
"loc_FFC64C20:\n"
                "LDR     R0, [R4,#0xC]\n"
                "CMP     R0, #0\n"
                "BNE     loc_FFC64C3C\n"
                "LDR     R0, =0xFFC643FC\n"
                "MOV     R1, #0\n"
                "BL      sub_FFC618C8\n"
                "STR     R0, [R4,#0xC]\n"
"loc_FFC64C3C:\n"
                "BL      sub_FFC65424\n"
                "BL      sub_FFC64460\n"
                "BL      sub_FFD379A8\n"
                "BL      sub_FFD38794\n"
                "LDMFD   SP!, {R4,LR}\n"
                "B       sub_FFD30070\n"
 );
} 

void __attribute__((naked,noinline)) sub_FFC64768_my(){ 
 asm volatile(
                "STMFD   SP!, {R0-R11,LR}\n"
                "LDR     R5, =0x5B9C\n"
                "MOV     R4, R1\n"
                "LDR     R1, [R5,#0x2C]\n"
                "ADD     R0, R5, #0\n"
                "LDR     R0, [R0,#0x14]\n"
                "CMP     R1, #0\n"
                "SUB     SP, SP, #4\n"
                "MVN     R9, #0\n"
                "BEQ     loc_FFC647E4\n"
                "SUB     R12, R4, #0x3000\n"
                "SUBS    R12, R12, #7\n"
                "BEQ     loc_FFC649E8\n"
                "CMP     R4, #0x800\n"
                "LDREQ   R1, [SP,#0x38-0x28]\n"
                "LDREQ   R2, [R5,#0x38]\n"
                "CMPEQ   R1, R2\n"
                "BNE     loc_FFC64B88\n"
                "MOV     R1, #0\n"
                "STR     R1, [R5,#0x2C]!\n"
                "CMP     R0, #0\n"
                "STR     R9, [R5,#0xC]\n"
                "BNE     loc_FFC64BEC\n"
                "BL      sub_FFC1A54C\n"
                "CMP     R0, #1\n"
                "BEQ     loc_FFC647DC\n"
                "BL      sub_FFC1A554\n"
                "CMP     R0, #1\n"
                "BNE     loc_FFC64BEC\n"
"loc_FFC647DC:\n"
                "BL      sub_FFC645B0\n"
                "B       loc_FFC64BEC\n"
"loc_FFC647E4:\n"
                "CMP     R0, #1\n"
                "SUBEQ   R12, R4, #0x2000\n"
                "SUBEQS  R12, R12, #0x1C\n"
                "BNE     loc_FFC64800\n"
                "MOV     R0, #0\n"
                "BL      sub_FFC64EF8\n"
                "B       loc_FFC64BEC\n"
"loc_FFC64800:\n"
                "BL      sub_FFC596C4\n"
                "LDR     R10, =0x9A5\n"
                "CMP     R0, #1\n"
                "SUB     R7, R10, #4\n"
                "SUB     R8, R10, #2\n"
                "BNE     loc_FFC64834\n"
                "CMP     R4, R10\n"
                "CMPNE   R4, R7\n"
                "CMPNE   R4, R8\n"
                "BNE     loc_FFC64834\n"
                "BL      sub_FFC58868\n"
                "STR     R4, [R5,#0x3C]\n"
                "B       loc_FFC64B88\n"
"loc_FFC64834:\n"
                "BL      sub_FFD2EE80\n"
                "CMP     R0, #1\n"
                "BNE     loc_FFC64854\n"
                "MOV     R0, R4\n"
                "BL      sub_FFC5A95C\n"
                "CMP     R0, #1\n"
                "CMPNE   R4, R10\n"
                "BEQ     loc_FFC64B88\n"
"loc_FFC64854:\n"
                "BL      sub_FFC1A624\n"
                "CMP     R0, #1\n"
                "BNE     loc_FFC6486C\n"
                "CMP     R4, R7\n"
                "CMPNE   R4, R8\n"
                "BEQ     loc_FFC64BEC\n"
"loc_FFC6486C:\n"
                "BL      sub_FFC61528\n"
                "LDR     R1, =0x9A2\n"
                "CMP     R0, #1\n"
                "ADD     R11, R1, #2\n"
                "BNE     loc_FFC64894\n"
                "CMP     R4, R7\n"
                "CMPNE   R4, R1\n"
                "CMPNE   R4, R8\n"
                "CMPNE   R4, R11\n"
                "BEQ     loc_FFC64BEC\n"
"loc_FFC64894:\n"
                "LDR     R12, =0x200A\n"
                "MOV     R6, #1\n"
                "CMP     R4, R12\n"
                "BEQ     loc_FFC649BC\n"
                "BGT     loc_FFC64918\n"
                "LDR     R12, =0x907\n"
                "CMP     R4, R12\n"
                "MOVEQ   R1, #2\n"
                "MOVEQ   R0, R10\n"
                "BEQ     loc_FFC64B28\n"
                "BGT     loc_FFC648F4\n"
                "SUB     R12, R4, #0x800\n"
                "LDR     R7, =0x2003\n"
                "SUBS    R12, R12, #0x26\n"
                "BEQ     loc_FFC64A00\n"
                "SUB     R12, R4, #0x800\n"
                "SUBS    R12, R12, #0x29\n"
                "BEQ     loc_FFC64A44\n"
                "CMP     R4, #0x860\n"
                "BEQ     loc_FFC64A94\n"
                "SUB     R12, R4, #0x800\n"
                "SUBS    R12, R12, #0x61\n"
                "BNE     loc_FFC64BA0\n"
                "B       loc_FFC64B88\n"
"loc_FFC648F4:\n"
                "CMP     R4, R7\n"
                "BEQ     loc_FFC64B20\n"
                "CMP     R4, R1\n"
                "BEQ     loc_FFC649BC\n"
                "CMP     R4, R8\n"
                "BEQ     loc_FFC64B20\n"
                "CMP     R4, R11\n"
                "BNE     loc_FFC64BA0\n"
                "B       loc_FFC649BC\n"
"loc_FFC64918:\n"
                "LDR     R12, =0x3149\n"
                "CMP     R4, R12\n"
                "MOVEQ   R1, #0\n"
                "MOVEQ   R0, #0x84\n"
                "BEQ     loc_FFC64B98\n"
                "BGT     loc_FFC64974\n"
                "SUB     R12, R4, #0x2000\n"
                "SUBS    R12, R12, #0x20\n"
                "LDREQ   R1, [SP,#0x38-0x28]\n"
                "MOVEQ   R0, #0x83\n"
                "BEQ     loc_FFC64B98\n"
                "SUB     R12, R4, #0x3000\n"
                "SUBS    R12, R12, #7\n"
                "BEQ     loc_FFC649D8\n"
                "SUB     R12, R4, #0x3100\n"
                "SUBS    R12, R12, #0x35\n"
                "BEQ     loc_FFC649B0\n"
                "SUB     R12, R4, #0x3000\n"
                "SUBS    R12, R12, #0x148\n"
                "BNE     loc_FFC64BA0\n"
                "MOV     R1, #0\n"
                "MOV     R0, #0x86\n"
                "B       loc_FFC64B98\n"
"loc_FFC64974:\n"
                "SUB     R12, R4, #0x3100\n"
                "SUBS    R12, R12, #0x4A\n"
                "BEQ     loc_FFC64B90\n"
                "SUB     R12, R4, #0x4000\n"
                "SUBS    R12, R12, #3\n"
                "BEQ     loc_FFC64B4C\n"
                "SUB     R12, R4, #0x4000\n"
                "SUBS    R12, R12, #8\n"
                "BEQ     loc_FFC64B30\n"
                "SUB     R12, R4, #0x4000\n"
                "SUBS    R12, R12, #0xF\n"
                "BNE     loc_FFC64BA0\n"
                "MOV     R0, #0x82\n"
                "BL      sub_FFC659F4\n"
                "B       loc_FFC64BEC\n"
"loc_FFC649B0:\n"
                "BL      sub_FFC65458\n"
                "CMP     R0, #4\n"
                "BNE     loc_FFC649C8\n"
"loc_FFC649BC:\n"
                "LDR     R1, [SP,#0x38-0x28]\n"
                "MOV     R0, R4\n"
                "B       loc_FFC64B18\n"
"loc_FFC649C8:\n"
                "LDR     R0, [R5,#0x1C]\n"
                "CMP     R0, #0\n"
                "BLNE    sub_FFC644F8\n"
                "B       loc_FFC64BEC\n"
"loc_FFC649D8:\n"
                "STR     R6, [R5,#0x1C]\n"
                "LDR     R0, [R5,#0x18]\n"
                "CMP     R0, #1\n"
                "BNE     loc_FFC649F4\n"
"loc_FFC649E8:\n"
                "BL      sub_FFC644F8\n"
"loc_FFC649EC:\n"
                "ADD     SP, SP, #0x14\n"
                "LDMFD   SP!, {R4-R11,PC}\n"
"loc_FFC649F4:\n"
                "MOV     R0, R4\n"
                "BL      sub_FFC646D8\n"
                "B       loc_FFC64BEC\n"
"loc_FFC64A00:\n"
                "BL      sub_FFC61528\n"
                "CMP     R0, #0\n"
                "BEQ     loc_FFC64A18\n"
                "MOV     R0, R4\n"
                "BL      sub_FFC61A98\n"
                "B       loc_FFC64BEC\n"
"loc_FFC64A18:\n"
                "LDR     R0, [R5,#0x10]\n"
                "LDR     R1, [R5,#0x14]\n"
                "ORR     R0, R0, R1\n"
                "LDR     R1, [R5,#0x1C]\n"
                "ORRS    R0, R0, R1\n"
                "BNE     loc_FFC64BEC\n"
                "MOV     R1, #0\n"
                "MOV     R0, R7\n"
                "BL      sub_FFC460D4\n"
                "BL      sub_FFD1EEC0\n"
                "B       loc_FFC64BEC\n"
"loc_FFC64A44:\n"
                "LDR     R0, [R5,#0x10]\n"
                "LDR     R1, [R5,#0x14]\n"
                "ORRS    R0, R0, R1\n"
                "BNE     loc_FFC64BEC\n"
                "BL      sub_FFC61AA4\n"
                "CMP     R0, #0\n"
                "LDREQ   R0, [R5,#0x1C]\n"
                "CMPEQ   R0, #0\n"
                "BNE     loc_FFC64BEC\n"
                "BL      sub_FFC61528\n"
                "CMP     R0, #0\n"
                "BNE     loc_FFC64BEC\n"
                "BL      sub_FFD38844\n"
                "CMP     R0, #0\n"
                "BNE     loc_FFC64BEC\n"
                "MOV     R1, #0\n"
                "MOV     R0, R7\n"
                "BL      sub_FFC460D4\n"
                "BL      sub_FFD1A0EC\n"
                "B       loc_FFC64BEC\n"
"loc_FFC64A94:\n"
                "LDR     R0, [R5,#0x44]\n"
                "CMP     R0, #0\n"
                "BNE     loc_FFC64AF0\n"
                "BL      sub_FFC61F98\n"
                "CMP     R0, #0\n"
                "BNE     loc_FFC64AB4\n"
"loc_FFC64AAC:\n"
                "MOV     R0, R6\n"
                "B       loc_FFC649EC\n"
"loc_FFC64AB4:\n"
                "LDR     R0, [R5,#0x44]\n"
                "CMP     R0, #0\n"
                "BNE     loc_FFC64AF0\n"
                "BL      sub_FFC65464\n"
                "CMP     R0, #0\n"
                "BNE     loc_FFC64AAC\n"
                "LDR     R0, [R5,#0x44]\n"
                "CMP     R0, #0\n"
                "BNE     loc_FFC64AF0\n"
                "BL      sub_FFC1A54C\n"
                "CMP     R0, #0\n"
                "BNE     loc_FFC64AAC\n"
                "BL      sub_FFC1A554\n"
                "CMP     R0, #0\n"
                "BNE     loc_FFC64AAC\n"
"loc_FFC64AF0:\n"
                "MOV     R1, #1\n"
                "MOV     R0, R8\n"
                "STR     R6, [R5,#0x44]\n"
                "BL      sub_FFC6460C_my\n"  //------>
                "MOV     R6, R0\n"
                "BL      sub_FFC65464\n"
                "CMP     R0, #1\n"
                "BNE     loc_FFC64AAC\n"
                "MOV     R1, #0\n"
                "MOV     R0, R11\n"
"loc_FFC64B18:\n"
                "BL      sub_FFC650C4_my\n"  //------>
                "B       loc_FFC649EC\n"
"loc_FFC64B20:\n"
                "MOV     R1, #1\n"
                "MOV     R0, R4\n"
"loc_FFC64B28:\n"
                "BL      sub_FFC6460C_my\n"  //------>
                "B       loc_FFC649EC\n"
"loc_FFC64B30:\n"
                "LDR     R0, [SP,#0x38-0x28]\n"
                "BL      sub_FFC601F0\n"
                "CMP     R0, #0\n"
                "LDREQ   R1, [SP,#0x38-0x28]\n"
                "MOVEQ   R0, R4\n"
                "BLEQ    sub_FFC650C4_my\n"  //------>
                "B       loc_FFC64B88\n"
"loc_FFC64B4C:\n"
                "LDR     R0, [R5,#0x3C]\n"
                "CMN     R0, #1\n"
                "BEQ     loc_FFC64B88\n"
                "MOV     R0, #0\n"
                "BL      sub_FFC5794C\n"
                "LDR     R0, [R5,#0x3C]\n"
                "CMP     R0, R7\n"
                "BNE     loc_FFC64B78\n"
                "BL      sub_FFC1A54C\n"
                "CMP     R0, #0\n"
                "BEQ     loc_FFC64B84\n"
"loc_FFC64B78:\n"
                "LDR     R0, [R5,#0x3C]\n"
                "MOV     R1, #0\n"
                "BL      sub_FFC5ABD8\n"
"loc_FFC64B84:\n"
                "STR     R9, [R5,#0x3C]\n"
"loc_FFC64B88:\n"
                "MOV     R0, #1\n"
                "B       loc_FFC649EC\n"
"loc_FFC64B90:\n"
                "MOV     R1, #0\n"
                "MOV     R0, #0x85\n"
"loc_FFC64B98:\n"
                "BL      sub_FFC659B4\n"
                "B       loc_FFC64BEC\n"
"loc_FFC64BA0:\n"
                "LDR     R12, =0x855\n"
                "CMP     R4, R12\n"
                "BEQ     loc_FFC64BDC\n"
                "BGT     loc_FFC64BC8\n"
                "SUB     R12, R4, #0x800\n"
                "SUBS    R12, R12, #0x38\n"
                "SUBNE   R12, R4, #0x800\n"
                "SUBNES  R12, R12, #0x39\n"
                "BNE     loc_FFC649BC\n"
                "B       loc_FFC64BDC\n"
"loc_FFC64BC8:\n"
                "SUB     R12, R4, #0x800\n"
                "SUBS    R12, R12, #0x56\n"
                "SUBNE   R12, R4, #0x800\n"
                "SUBNES  R12, R12, #0x5D\n"
                "BNE     loc_FFC649BC\n"
"loc_FFC64BDC:\n"
                "LDR     R0, [R5,#0x10]\n"
                "LDR     R1, [R5,#0x14]\n"
                "ORRS    R0, R0, R1\n"
                "BEQ     loc_FFC649BC\n"
"loc_FFC64BEC:\n"
                "MOV     R0, #0\n"
                "B       loc_FFC649EC\n"
 );
} 
//
void __attribute__((naked,noinline)) sub_FFC6460C_my(){
asm volatile(
                "STMFD   SP!, {R4-R6,LR}\n"
                "LDR     R6, =0x5B9C\n"
                "MOV     R4, R0\n"
                "LDR     R0, [R6,#0x1C]\n"
                "MOV     R5, R1\n"
                "CMP     R0, #0\n"
                "LDRNE   R1, =0xFFC64744\n"
                "BNE     loc_FFC646BC\n"
                "BL      sub_FFC65464\n"
                "CMP     R0, #1\n"
                "BNE     loc_FFC64648\n"
"loc_FFC64638:\n"
                "MOV     R0, R4\n"
                "LDMFD   SP!, {R4-R6,LR}\n"
                "MOV     R1, #0\n"
                "B       sub_FFC650C4_my\n" //------>
"loc_FFC64648:\n"
                "CMP     R5, #2\n"
                "BNE     loc_FFC64660\n"
                "BL      sub_FFC63BA0\n"
                "CMP     R0, #0\n"
                "BEQ     loc_FFC646AC\n"
                "B       loc_FFC64674\n"
"loc_FFC64660:\n"
                "CMP     R5, #1\n"
                "BNE     loc_FFC646AC\n"
                "BL      sub_FFC63BB8\n"
                "CMP     R0, #0\n"
                "BNE     loc_FFC646AC\n"
"loc_FFC64674:\n"
                "MOV     R0, #0\n"
                "BL      sub_FFC5794C\n"
                "SUB     R12, R4, #0x900\n"
                "SUBS    R12, R12, #0xA1\n"
                "SUBNE   R12, R4, #0x900\n"
                "SUBNES  R12, R12, #0xA3\n"
                "SUBNE   R12, R4, #0x900\n"
                "SUBNES  R12, R12, #0xA5\n"
                "LDREQ   R0, =0xC507\n"
                "MOVEQ   R1, #0\n"
                "BLEQ    sub_FFC460D4\n"
                "MOV     R0, #0\n"
                "STR     R0, [R6,#0x44]\n"
                "B       loc_FFC646C4\n"
"loc_FFC646AC:\n"
                "BL      sub_FFC645B0\n"
                "CMP     R0, #0\n"
                "BNE     loc_FFC646CC\n"
                "LDR     R1, =0xFFC64754\n"
"loc_FFC646BC:\n"
                "MOV     R0, #0x60\n"
                "BL      sub_FFC542D8\n"
"loc_FFC646C4:\n"
                "MOV     R0, #0\n"
                "LDMFD   SP!, {R4-R6,PC}\n"
"loc_FFC646CC:\n"
                "MOV     R0, R5\n"
                "BL      sub_FFD2DF68\n"
                "B       loc_FFC64638\n"
 );
}

void __attribute__((naked,noinline)) sub_FFC650C4_my(){ 
 asm volatile(
                "STMFD   SP!, {R4-R8,LR}\n"
                "MOV     R7, R1\n"
                "MOV     R4, R0\n"
                "BL      sub_FFC654E0\n"
                "LDR     R5, =0x5BE4\n"
                "LDR     R3, =0x200A\n"
                "LDR     R12, [R5]\n"
                "LDR     R2, =0x4008\n"
                "LDR     R6, =0x9A3\n"
                "LDR     R0, =0x3007\n"
                "LDR     R1, =0x1051\n"
                "CMP     R12, #9\n"
                "ADD     LR, R3, #0x15\n"
                "ADDLS   PC, PC, R12,LSL#2\n"
                "B       loc_FFC6541C\n"
"loc_FFC65100:\n"
                "B       loc_FFC65128\n"
"loc_FFC65104:\n"
                "B       loc_FFC65138\n"
"loc_FFC65108:\n"
                "B       loc_FFC65148\n"
"loc_FFC6510C:\n"
                "B       loc_FFC651BC\n"
"loc_FFC65110:\n"
                "B       loc_FFC651FC\n"
"loc_FFC65114:\n"
                "B       loc_FFC65284\n"
"loc_FFC65118:\n"
                "B       loc_FFC652B4\n"
"loc_FFC6511C:\n"
                "B       loc_FFC65364\n"
"loc_FFC65120:\n"
                "B       loc_FFC65328\n"
"loc_FFC65124:\n"
                "B       loc_FFC6538C\n"
"loc_FFC65128:\n"
                "MOV     R1, R7\n"
                "MOV     R0, R4\n"
                "LDMFD   SP!, {R4-R8,LR}\n"
                "B       sub_FFC65040\n"
"loc_FFC65138:\n"
                "MOV     R1, R7\n"
                "MOV     R0, R4\n"
                "LDMFD   SP!, {R4-R8,LR}\n"
                "B       sub_FFC65660_my\n"  //------>
"loc_FFC65148:\n"
                "CMP     R4, R1\n"
                "BEQ     loc_FFC651AC\n"
                "SUB     R12, R4, #0x2000\n"
                "SUBS    R12, R12, #6\n"
                "BEQ     loc_FFC65170\n"
                "CMP     R4, R0\n"
                "BEQ     loc_FFC651B4\n"
                "SUB     R12, R4, #0x3100\n"
                "SUBS    R12, R12, #0x4B\n"
                "BNE     loc_FFC6541C\n"
"loc_FFC65170:\n"
                "BL      sub_FFC6458C\n"
                "MOV     R0, #0\n"
                "BL      sub_FFC654C8\n"
                "LDR     R0, [R5,#8]\n"
                "CMP     R0, #0\n"
                "MOVNE   R1, #0\n"
                "MOVNE   R0, R6\n"
                "BNE     loc_FFC651A4\n"
                "LDR     R0, [R5,#4]\n"
                "CMP     R0, #0\n"
                "BEQ     loc_FFC653CC\n"
                "LDR     R0, =0x9A1\n"
                "MOV     R1, #0\n"
"loc_FFC651A4:\n"
                "BL      sub_FFC65040\n"
                "B       loc_FFC653CC\n"
"loc_FFC651AC:\n"
                "BL      sub_FFC655D4\n"
                "B       loc_FFC653CC\n"
"loc_FFC651B4:\n"
                "BL      sub_FFC655EC\n"
                "B       loc_FFC653CC\n"
"loc_FFC651BC:\n"
                "SUB     R12, R4, #0x900\n"
                "SUBS    R12, R12, #0xA2\n"
                "BEQ     loc_FFC651EC\n"
                "CMP     R4, R6\n"
                "BEQ     loc_FFC651E4\n"
                "CMP     R4, R1\n"
                "BEQ     loc_FFC651F4\n"
                "CMP     R4, R0\n"
                "BLEQ    sub_FFC655EC\n"
                "B       loc_FFC6541C\n"
"loc_FFC651E4:\n"
                "BL      sub_FFC64FE4_my\n"  //------>
                "B       loc_FFC6541C\n"
"loc_FFC651EC:\n"
                "BL      sub_FFC655B0\n"
                "B       loc_FFC6541C\n"
"loc_FFC651F4:\n"
                "BL      sub_FFC655D4\n"
                "B       loc_FFC6541C\n"
"loc_FFC651FC:\n"
                "CMP     R4, LR\n"
                "BEQ     loc_FFC65258\n"
                "BGT     loc_FFC65224\n"
                "CMP     R4, R6\n"
                "BEQ     loc_FFC65240\n"
                "CMP     R4, R1\n"
                "BEQ     loc_FFC65270\n"
"loc_FFC65218:\n"
                "CMP     R4, R3\n"
                "BNE     loc_FFC6541C\n"
                "B       loc_FFC65234\n"
"loc_FFC65224:\n"
                "CMP     R4, R0\n"
                "BEQ     loc_FFC65264\n"
"loc_FFC6522C:\n"
                "CMP     R4, R2\n"
                "BNE     loc_FFC6541C\n"
"loc_FFC65234:\n"
                "BL      sub_FFC6563C\n"
                "BL      sub_FFC655B0\n"
                "B       loc_FFC653CC\n"
"loc_FFC65240:\n"
                "BL      sub_FFC16B94\n"
                "MOV     R0, #5\n"
                "BL      sub_FFC654C8\n"
                "MOV     R0, #0\n"
                "STR     R0, [R5,#0xC]\n"
                "B       loc_FFC653CC\n"
"loc_FFC65258:\n"
                "MOV     R0, #5\n"
                "BL      sub_FFC654C8\n"
                "B       loc_FFC652A8\n"
"loc_FFC65264:\n"
                "BL      sub_FFC16B94\n"
                "BL      sub_FFC6563C\n"
                "B       loc_FFC6535C\n"
"loc_FFC65270:\n"
                "BL      sub_FFC16B94\n"
                "BL      sub_FFC6563C\n"
                "B       loc_FFC652BC\n"
"loc_FFC6527C:\n"
                "BL      sub_FFC654C8\n"
                "B       loc_FFC653CC\n"
"loc_FFC65284:\n"
                "CMP     R4, LR\n"
                "BEQ     loc_FFC652A8\n"
                "BGT     loc_FFC6529C\n"
                "CMP     R4, R1\n"
                "BNE     loc_FFC65218\n"
                "B       loc_FFC652BC\n"
"loc_FFC6529C:\n"
                "CMP     R4, R0\n"
                "BNE     loc_FFC6522C\n"
                "B       loc_FFC6535C\n"
"loc_FFC652A8:\n"
                "MOV     R0, R7\n"
                "BL      sub_FFC65608\n"
                "B       loc_FFC653CC\n"
"loc_FFC652B4:\n"
                "CMP     R4, R1\n"
                "BNE     loc_FFC6541C\n"
"loc_FFC652BC:\n"
                "MOV     R0, #8\n"
                "B       loc_FFC6527C\n"
"loc_FFC65328:\n"
                "CMP     R4, R0\n"
                "BEQ     loc_FFC6535C\n"
                "BGT     loc_FFC65348\n"
                "CMP     R4, R3\n"
                "BEQ     loc_FFC651AC\n"
                "CMP     R4, LR\n"
                "BEQ     loc_FFC652A8\n"
                "B       loc_FFC6541C\n"
"loc_FFC65348:\n"
                "CMP     R4, R2\n"
                "SUBNE   R12, R4, #0x4000\n"
                "SUBNES  R12, R12, #0xE\n"
                "BEQ     loc_FFC651AC\n"
                "B       loc_FFC6541C\n"
"loc_FFC6535C:\n"
                "MOV     R0, #7\n"
                "B       loc_FFC6527C\n"
"loc_FFC65364:\n"
                "CMP     R4, R3\n"
                "BEQ     loc_FFC6537C\n"
                "CMP     R4, LR\n"
                "BEQ     loc_FFC652A8\n"
                "CMP     R4, R2\n"
                "BNE     loc_FFC6541C\n"
"loc_FFC6537C:\n"
                "BL      sub_FFC655B0\n"
                "MOV     R0, #0\n"
                "BL      sub_FFC646D8\n"
                "B       loc_FFC653CC\n"
"loc_FFC6538C:\n"
                "SUB     R12, R4, #0x800\n"
                "SUBS    R12, R12, #0x4A\n"
                "BEQ     loc_FFC653D4\n"
                "CMP     R4, R1\n"
                "BEQ     loc_FFC6540C\n"
                "CMP     R4, R0\n"
                "BEQ     loc_FFC653FC\n"
                "SUB     R12, R4, #0x3100\n"
                "SUBS    R12, R12, #0x2A\n"
                "BNE     loc_FFC6541C\n"
                "BL      sub_FFC65568\n"
                "LDR     R0, [R5,#0x14]\n"
                "CMP     R0, #0\n"
                "BNE     loc_FFC653CC\n"
                "BL      sub_FFC65584_my\n"  //----------------> 
                "BL      sub_FFD2EE8C\n"
"loc_FFC653CC:\n"
                "MOV     R0, #0\n"
                "LDMFD   SP!, {R4-R8,PC}\n"
"loc_FFC653D4:\n"
                "BL      sub_FFC65568\n"
                "LDR     R0, =0x8007\n"
                "MOV     R1, #0\n"
                "BL      sub_FFC5BEAC\n"
                "BL      sub_FFD2DF1C\n"
                "BL      sub_FFC655B0\n"
                "BL      sub_FFD2EE8C\n"
                "BL      sub_FFC6458C\n"
                "MOV     R0, #0\n"
                "B       loc_FFC6527C\n"
"loc_FFC653FC:\n"
                "BL      sub_FFC65568\n"
                "BL      sub_FFD2DF1C\n"
                "BL      sub_FFD2EE8C\n"
                "B       loc_FFC651B4\n"
"loc_FFC6540C:\n"
                "BL      sub_FFC65568\n"
                "BL      sub_FFD2DF1C\n"
                "BL      sub_FFD2EE8C\n"
                "B       loc_FFC651AC\n"
"loc_FFC6541C:\n"
                "MOV     R0, #1\n"
                "LDMFD   SP!, {R4-R8,PC}\n"
				".ltorg\n"   
 );
} 

void __attribute__((naked,noinline)) sub_FFC65660_my(){ 
 asm volatile(
                "LDR     R3, =0x5BE4\n"
                "LDR     R12, =0x2006\n"
                "STMFD   SP!, {R4,LR}\n"
                "LDR     R1, [R3,#0xC]\n"
                "LDR     R2, [R3,#0x14]\n"
                "CMP     R0, R12\n"
                "BEQ     loc_FFC656D4\n"
                "BGT     loc_FFC656A0\n"
                "SUB     R12, R0, #0x900\n"
                "SUBS    R12, R12, #0xA2\n"
                "BEQ     loc_FFC656F8\n"
                "SUB     R12, R0, #0x1000\n"
                "SUBS    R12, R12, #0x51\n"
                "BNE     loc_FFC6571C\n"
                "BL      sub_FFC655D4\n"
                "B       loc_FFC65714\n"
"loc_FFC656A0:\n"
                "SUB     R12, R0, #0x3000\n"
                "SUBS    R12, R12, #7\n"
                "BEQ     loc_FFC65710\n"
                "SUB     R12, R0, #0x3100\n"
                "SUBS    R12, R12, #0x4B\n"
                "BNE     loc_FFC6571C\n"
                "CMP     R2, #0\n"
                "BNE     loc_FFC65714\n"
                "LDR     R0, [R3,#8]\n"
                "ORRS    R0, R0, R1\n"
                "BEQ     loc_FFC656E0\n"
                "BL      sub_FFC64FE4_my\n"  //------>
                "B       loc_FFC65714\n"
"loc_FFC656D4:\n"
                "CMP     R2, #0\n"
                "BLEQ    sub_FFC63BD8\n"
                "B       loc_FFC65714\n"
"loc_FFC656E0:\n"
                "LDR     R0, [R3,#4]\n"
                "CMP     R0, #0\n"
                "MOVNE   R0, #3\n"
                "BNE     loc_FFC65708\n"
                "BL      sub_FFC655B0\n"
                "B       loc_FFC65714\n"
"loc_FFC656F8:\n"
                "CMP     R1, #0\n"
                "BNE     loc_FFC65714\n"
                "BL      sub_FFC1674C\n"
                "MOV     R0, #2\n"
"loc_FFC65708:\n"
                "BL      sub_FFC654C8\n"
                "B       loc_FFC65714\n"
"loc_FFC65710:\n"
                "BL      sub_FFC655EC\n"
"loc_FFC65714:\n"
                "MOV     R0, #0\n"
                "LDMFD   SP!, {R4,PC}\n"
"loc_FFC6571C:\n"
                "MOV     R0, #1\n"
                "LDMFD   SP!, {R4,PC}\n"
 );
} 

void __attribute__((naked,noinline)) sub_FFC64FE4_my(){ 
 asm volatile(
                "STMFD   SP!, {R4,LR}\n"
                "LDR     R1, =0xFFC652C4\n"
                "MOV     R0, #0x60\n"
                "BL      sub_FFC542D8\n"
                "LDR     R4, =0x5BE4\n"
                "LDR     R0, [R4,#0x10]\n"
                "CMP     R0, #0\n"
                "LDMEQFD SP!, {R4,LR}\n"
                "BEQ     sub_FFC65584_my\n"  //------------->
                "LDR     R1, =0xFFC652E0\n"
                "MOV     R0, #0x60\n"
                "BL      sub_FFC542D8\n"
                "BL      sub_FFD2EEB8\n"
                "LDR     R0, [R4,#0x18]\n"
                "CMP     R0, #1\n"
                "MOVNE   R0, #1\n"
                "STRNE   R0, [R4,#0x18]\n"
                "BLNE    sub_FFC5B568\n"
                "MOV     R0, #9\n"
                "BL      sub_FFC654C8\n"
                "LDMFD   SP!, {R4,LR}\n"
                "B       sub_FFD2DDD8\n"
 );
} 

void __attribute__((naked,noinline)) sub_FFC65584_my(){ 
 asm volatile(
                "STMFD   SP!, {R4,LR}\n"
                "LDR     R1, =0xFFC6573C\n"
                "MOV     R0, #0x60\n"
                "BL      sub_FFC542D8\n"
                "LDR     R1, =0x5BE4\n"
                "MOV     R0, #0\n"
                "STR     R0, [R1,#0xC]\n"
                "MOV     R0, #4\n"
                "BL      sub_FFC654C8\n"
                "LDMFD   SP!, {R4,LR}\n"
                "B       sub_FFC64C94_my\n" //------------->
 );
} 

//

void __attribute__((naked,noinline)) sub_FFC64C94_my(){ 
 asm volatile(
                "LDR     R0, =0x5B9C\n"
                "STMFD   SP!, {R3,LR}\n"
                "LDR     R1, [R0,#0x40]\n"
                "CMP     R1, #1\n"
                "MOVNE   R1, #1\n"
                "STRNE   R1, [R0,#0x40]\n"
                "BLNE    sub_FFC5B568\n"
                "MOV     R1, #0\n"
                "MOV     R0, #0x80\n"
                "BL      sub_FFC659B4\n"
                "MOV     R2, #2\n"
                "MOV     R1, SP\n"
                "MOV     R0, #0x6B\n"
                "BL      sub_FFC56F08\n"
                "MOV     R2, #2\n"
                "MOV     R1, SP\n"
                "MOV     R0, #0xA3\n"
                "BL      sub_FFC56E08\n"
                "BL      sub_FFC46194\n"
                "BL      sub_FFC63E9C\n"
                "BL      sub_FFC16B64_my\n"  //------>
                "BL      sub_FFC64544\n"
                "LDMFD   SP!, {R12,PC}\n"
 );
} 

void __attribute__((naked,noinline)) sub_FFC16B64_my(){ 
 asm volatile(
                "STMFD   SP!, {R4,LR}\n"
                "MOV     R4, R0\n"
                "MOV     R0, #0x20\n"
                "LDR     R1, =0xFFC16C84\n"
                "BL      sub_FFC542D8\n"
                "BL      sub_FFC16FB8\n"
                "CMP     R0, #0\n"
                "LDMNEFD SP!, {R4,PC}\n"
                "BL      sub_FFC477D0\n"
                "MOV     R0, R4\n"
                "LDMFD   SP!, {R4,LR}\n"
                "B       sub_FFC498C8_my\n"  //------>
 );
} 

void __attribute__((naked,noinline)) sub_FFC498C8_my(){ 
 asm volatile(
                "STMFD   SP!, {R4-R8,LR}\n"
                "MOV     R8, R0\n"
                "MOV     R0, #0x41\n"
                "SUB     SP, SP, #0x38\n"
                "MOV     R5, #0\n"
                "STR     R0, [SP,#0x50-0x1C]\n"
                "BL      sub_FFC49898\n"
                "CMP     R0, #0\n"
                "LDRNE   R1, =0x163\n"
                "BNE     loc_FFC49A74\n"
                "LDR     R4, =0x530C\n"
                "MOV     R1, #0x5E\n"
                "LDR     R0, [R4,#8]\n"
                "BL      sub_FFC173EC\n"
                "BL      sub_FFC57098\n"
                "STR     R0, [R4,#4]\n"
                "MOV     R0, #0\n"
                "BL      sub_FFC50EDC\n"
                "STR     R0, [SP,#0x50-0x28]\n"
                "ADD     R0, SP, #0x50-0x28\n"
                "MOV     R1, SP\n"
                "BL      sub_FFC51028\n"
                "MOV     R0, SP\n"
                "BL      sub_FFC50F10\n"
                "STR     R0, [SP,#0x50-0x24]\n"
                "LDR     R0, [R4,#4]\n"
                "MOV     R3, #4\n"
                "ADD     R2, SP, #0x50-0x24\n"
                "MOV     R1, #0x34\n"
                "BL      sub_FFC573AC\n"
                "LDR     R7, [SP,#0x50-0x24]\n"
                "BL      sub_FFC49DB8\n"
                "MOV     R6, #0\n"
                "ADD     R1, SP, #0x50-0x28\n"
                "ADD     R0, SP, #0x50-0x24\n"
                "STR     R6, [SP,#0x50-0x24]\n"
                "STR     R6, [SP,#0x50-0x28]\n"
                "BL      sub_FFC1F6F8\n"
                "LDR     R0, [R4,#4]\n"
                "MOV     R3, #2\n"
                "ADD     R2, SP, #0x50-0x24\n"
                "MOV     R1, #0x2F\n"
                "BL      sub_FFC573AC\n"
                "LDR     R0, [R4,#4]\n"
                "MOV     R3, #2\n"
                "ADD     R2, SP, #0x50-0x28\n"
                "MOV     R1, #0x2D\n"
                "BL      sub_FFC573AC\n"
                "ADD     R1, SP, #0x50-0x28\n"
                "ADD     R0, SP, #0x50-0x24\n"
                "BL      sub_FFC23058\n"
                "LDR     R0, [R4,#4]\n"
                "MOV     R3, #2\n"
                "ADD     R2, SP, #0x50-0x24\n"
                "MOV     R1, #0x30\n"
                "BL      sub_FFC573AC\n"
                "ADD     R1, SP, #0x50-0x28\n"
                "ADD     R0, SP, #0x50-0x24\n"
                "BL      sub_FFC1FED0\n"
                "LDR     R0, [R4,#4]\n"
                "MOV     R3, #2\n"
                "ADD     R2, SP, #0x50-0x28\n"
                "MOV     R1, #0x2E\n"
                "BL      sub_FFC573AC\n"
                "LDR     R0, [R4,#4]\n"
                "MOV     R3, #2\n"
                "ADD     R2, SP, #0x50-0x24\n"
                "MOV     R1, #0xB8\n"
                "BL      sub_FFC57458\n"
                "TST     R0, #1\n"
                "LDRNE   R1, =0x142\n"
                "LDRNE   R0, =0xFFC49CEC\n"
                "BLNE    sub_FFC0BDB8\n"
                "LDRH    R0, [SP,#0x50-0x24]\n"
                "MOV     R3, #4\n"
                "ADD     R2, SP, #0x50-0x28\n"
                "CMP     R0, #0\n"
                "MOVNE   R0, #1\n"
                "STR     R0, [SP,#0x50-0x28]\n"
                "LDR     R0, [R4,#4]\n"
                "MOV     R1, #0x92\n"
                "BL      sub_FFC573AC\n"
                "MOV     R2, #1\n"
                "ADD     R1, SP, #0x50-0x1C\n"
                "MOV     R0, #0xFA\n"
                "BL      sub_FFC56F08\n"
                "TST     R0, #1\n"
                "LDRNE   R1, =0x17A\n"
                "LDRNE   R0, =0xFFC49CEC\n"
                "BLNE    sub_FFC0BDB8\n"
                "LDRB    R0, [SP,#0x50-0x1C]\n"
                "MOV     R3, R8\n"
                "MOV     R2, #0x14\n"
                "AND     R1, R0, #0xFF\n"
                "ADD     R0, SP, #0x50-0x20\n"
                "STR     R7, [SP,#0x50-0x50]\n"
                "BL      sub_FFCE9634\n"
                "TST     R0, #1\n"
                "LDRNE   R1, =0x17E\n"
                "BNE     loc_FFC49A74\n"
                "LDR     R0, =0x1966C\n"
                "LDR     R1, [SP,#0x50-0x20]\n"
                "MOV     R2, #0x10\n"
                "BL      sub_FFCDC4D8\n"
                "TST     R0, #1\n"
                "BEQ     loc_FFC49A84\n"
                "LDR     R1, =0x186\n"
"loc_FFC49A74:\n"
                "LDR     R0, =0xFFC49CEC\n"
                "BL      sub_FFC0BDB8\n"
"loc_FFC49A7C:\n"
                "ADD     SP, SP, #0x38\n"
                "LDMFD   SP!, {R4-R8,PC}\n"
"loc_FFC49A84:\n"
                "LDR     R0, [R4,#4]\n"
                "MOV     R3, #4\n"
                "ADD     R2, SP, #0x50-0x20\n"
                "MOV     R1, #0x2B\n"
                "BL      sub_FFC573AC\n"
                "BL      sub_FFC65B98\n"
                "LDRSB   R1, [SP,#0x50-0x1C]\n"
                "CMP     R0, R1\n"
                "MOVEQ   R7, #0\n"
                "BEQ     loc_FFC49AD8\n"
                "LDR     R5, =0x1966C\n"
                "MOV     R0, R5\n"
                "BL      sub_FFC65D14\n"
                "MOV     R8, R0\n"
                "BL      sub_FFC94698\n"
                "CMP     R8, R0\n"
                "MOV     R7, R0\n"
                "LDRLS   R1, =0x193\n"
                "LDRLS   R0, =0xFFC49CEC\n"
                "BLLS    sub_FFC0BDB8\n"
                "SUB     R7, R8, R7\n"
"loc_FFC49AD8:\n"
                "BL      sub_FFC454E0_my\n"  //------>
                "LDR     R0, =0x19690\n"
                "LDRH    R3, [R0,#0x46]\n"
                "LDRH    R2, [R0,#0x44]\n"
                "LDR     R1, [R0,#0x40]\n"
                "LDR     R0, [R0,#0x3C]\n"
                "BL      sub_FFC44560\n"
                "MOV     R3, #0\n"
                "LDR     R2, =0xFFC49860\n"
                "MOV     R1, #0\n"
                "LDR     R0, =0xFFC49874\n"
                "ADD     R8, SP, #0x50-0x44\n"
                "STMIA   R8, {R0-R3}\n"
                "LDR     R2, =0xFFC49884\n"
                "LDR     R1, =0xFFC49870\n"
                "STMEA   SP, {R1-R3}\n"
                "LDR     R1, [R4,#4]\n"
                "MOV     R3, R6\n"
                "MOV     R2, R7\n"
                "MOV     R0, R5\n"
                "BL      sub_FFC448BC\n"
                "LDR     R0, [R4,#8]\n"
                "MOV     R1, #0x20\n"
                "BL      sub_FFC173B8\n"
                "B       loc_FFC49A7C\n"
 );
} 


void __attribute__((naked,noinline)) sub_FFC454E0_my(){ 
 asm volatile(
                "STMFD   SP!, {R3-R9,LR}\n"
                "LDR     R5, =0x51A0\n"
                "MOV     R6, #0\n"
                "STR     R6, [R5,#0x20]\n"
                "LDR     R0, [R5,#4]\n"
                "LDR     R8, =0x2710\n"
                "CMP     R0, #0\n"
                "BNE     loc_FFC45598\n"
                "MOV     R0, #1\n"
                "STR     R0, [R5,#4]\n"
                "MOV     R0, #0\n"
                "MOV     R1, #0\n"
                "BL      sub_FFC0BC34\n"
                "STR     R0, [R5,#0x10]\n"
                "MOV     R0, #0\n"
                "MOV     R1, #0\n"
                "BL      sub_FFC0BC34\n"
                "STR     R0, [R5,#0x14]\n"
                "MOV     R0, #0\n"
                "MOV     R1, #0xA\n"
                "BL      sub_FFC0BBEC\n"
                "STR     R0, [R5,#0x18]\n"
                "MOV     R0, #0\n"
                "MOV     R1, #0xA\n"
                "BL      sub_FFC0BBEC\n"
                "LDR     R7, =0x19280\n"
                "MOV     R4, #9\n"
                "ADD     R9, R4, #0x2D4\n"
                "STR     R0, [R5,#0x1C]\n"
"loc_FFC45554:\n"
                "RSB     R0, R4, R4,LSL#3\n"
                "STR     R6, [R7,R0,LSL#2]\n"
                "ADD     R1, R7, R0,LSL#2\n"
                "STR     R9, [SP,#0x20-0x20]\n"
                "LDR     R0, [R5,#0x1C]\n"
                "LDR     R3, =0xFFC4485C\n"
                "MOV     R2, R8\n"
                "BL      sub_FFC0BCF8\n"
                "SUBS    R4, R4, #1\n"
                "BPL     loc_FFC45554\n"
                "MOV     R3, #0\n"
                "STR     R3, [SP]\n"
                "LDR     R3, =MovieRecord_Task_my\n"  //------>
                "MOV     R2, #0x1000\n"
                "MOV     R1, #0x14\n"
                "LDR     R0, =0xFFC456E8\n"
                "BL      sub_FFC0BBB8\n"
"loc_FFC45598:\n"
                "BL      sub_FFD07C28\n"
                "BL      sub_FFC455FC\n"
                "MOV     R1, R0\n"
                "MOV     R0, #0xB\n"
                "ADD     R3, R0, #0x2DC\n"
                "STR     R0, [R1]\n"
                "STR     R3, [SP,#0x20-0x20]\n"
                "LDR     R3, =0xFFC4485C\n"
                "MOV     R2, R8\n"
                "LDR     R0, [R5,#0x18]\n"
                "BL      sub_FFC0BCF8\n"
                "LDMFD   SP!, {R3-R9,PC}\n"
 );
} 

void __attribute__((naked,noinline)) MovieRecord_Task_my(){ //0xFFC453D8
 asm volatile(
                "STMFD   SP!, {R2-R8,LR}\n"
                "LDR     R8, =0x32B\n"
                "LDR     R7, =0x2710\n"
                "LDR     R4, =0x51A0\n"
                "MOV     R6, #0\n"
                "MOV     R5, #1\n"
"loc_FFC453F0:\n"
                "LDR     R0, [R4,#0x18]\n"
                "MOV     R2, #0\n"
                "ADD     R1, SP, #0x20-0x1C\n"
                "BL      sub_FFC1763C\n"
                "LDR     R0, [R4,#0x20]\n"
                "CMP     R0, #0\n"
                "BNE     loc_FFC454C0\n"
                "LDR     R0, [SP,#0x20-0x1C]\n"
                "LDR     R1, [R0]\n"
                "SUB     R1, R1, #2\n"
                "CMP     R1, #9\n"
                "ADDLS   PC, PC, R1,LSL#2\n"
                "B       loc_FFC454C0\n"
"loc_FFC45424:\n"
                "B       loc_FFC45474\n"
"loc_FFC45428:\n"
                "B       loc_FFC45494\n"
"loc_FFC4542C:\n"
                "B       loc_FFC454A4\n"
"loc_FFC45430:\n"
                "B       loc_FFC454AC\n"
"loc_FFC45434:\n"
                "B       loc_FFC4547C\n"
"loc_FFC45438:\n"
                "B       loc_FFC454B4\n"
"loc_FFC4543C:\n"
                "B       loc_FFC45484\n"
"loc_FFC45440:\n"
                "B       loc_FFC454C0\n"
"loc_FFC45444:\n"
                "B       loc_FFC454BC\n"
"loc_FFC45448:\n"
                "B       loc_FFC4544C\n"
"loc_FFC4544C:\n"
                "LDR     R0, =0xFFC450D4\n"
                "STR     R6, [R4,#0x34]\n"
                "STR     R0, [R4,#0xA0]\n"
                "LDR     R0, =0xFFC44B4C\n"
                "LDR     R2, =0xFFC44A68\n"
                "LDR     R1, =0x193A8\n"
                "STR     R6, [R4,#0x24]\n"
                "BL      sub_FFCA1258\n"
                "STR     R5, [R4,#0x38]\n"
                "B       loc_FFC454C0\n"
"loc_FFC45474:\n"
				"BL      unlock_optical_zoom\n" //  +
                "BL      sub_FFC451CC\n"
                "B       loc_FFC454C0\n"
"loc_FFC4547C:\n"
                "BL      sub_FFC44ED4_my\n"  //------------------->
                "B       loc_FFC454C0\n"
"loc_FFC45484:\n"
                "LDR     R1, [R0,#0x10]\n"
                "LDR     R0, [R0,#4]\n"
                "BL      sub_FFD08834\n"
                "B       loc_FFC454C0\n"
"loc_FFC45494:\n"
                "LDR     R0, [R4,#0x38]\n"
                "CMP     R0, #5\n"
                "STRNE   R5, [R4,#0x28]\n"
                "B       loc_FFC454C0\n"
"loc_FFC454A4:\n"
                "BL      sub_FFC44CDC\n"
                "B       loc_FFC454C0\n"
"loc_FFC454AC:\n"
                "BL      sub_FFC44B98\n"
                "B       loc_FFC454C0\n"
"loc_FFC454B4:\n"
                "BL      sub_FFC449F4\n"
                "B       loc_FFC454C0\n"
"loc_FFC454BC:\n"
                "BL      sub_FFC45628\n"
"loc_FFC454C0:\n"
                "LDR     R1, [SP,#0x20-0x1C]\n"
                "LDR     R3, =0xFFC4485C\n"
                "STR     R6, [R1]\n"
                "STR     R8, [SP,#0x20-0x20]\n"
                "LDR     R0, [R4,#0x1C]\n"
                "MOV     R2, R7\n"
                "BL      sub_FFC0BCF8\n"
                "B       loc_FFC453F0\n"
 );
} 

void __attribute__((naked,noinline)) sub_FFC44ED4_my(){ 
 asm volatile(                                   	
                "STMFD   SP!, {R4-R8,LR}\n"
                "SUB     SP, SP, #0x40\n"
                "MOV     R6, #0\n"
                "LDR     R5, =0x51A0\n"
                "MOV     R4, R0\n"
                "STR     R6, [SP,#0x58-0x28]\n"
                "STR     R6, [SP,#0x58-0x30]\n"
                "LDR     R0, [R5,#0x38]\n"
                "MOV     R8, #4\n"
                "CMP     R0, #3\n"
                "STREQ   R8, [R5,#0x38]\n"
                "LDR     R0, [R5,#0xA0]\n"
                //"BLX     R0\n"
				".long   0xE12FFF30\n"
                "LDR     R0, [R5,#0x38]\n"
                "CMP     R0, #4\n"
                "BNE     loc_FFC44FAC\n"
                "ADD     R3, SP, #0x58-0x30\n"
                "ADD     R2, SP, #0x58-0x30+4\n"
                "ADD     R1, SP, #0x58-0x28\n"
                "ADD     R0, SP, #0x58-0x24\n"
                "BL      sub_FFD089C8\n"
                "CMP     R0, #0\n"
                "MOV     R7, #1\n"
                "BNE     loc_FFC44F50\n"
                "LDR     R1, [R5,#0x28]\n"
                "CMP     R1, #1\n"
                "BNE     loc_FFC44FB4\n"
                "LDR     R1, [R5,#0x50]\n"
                "LDR     R2, [R5,#0x3C]\n"
                "CMP     R1, R2\n"
                "BCC     loc_FFC44FB4\n"
"loc_FFC44F50:\n"
                "CMP     R0, #0x80000001\n"
                "STREQ   R8, [R5,#0x54]\n"
                "BEQ     loc_FFC44F88\n"
                "CMP     R0, #0x80000003\n"
                "STREQ   R7, [R5,#0x54]\n"
                "BEQ     loc_FFC44F88\n"
                "CMP     R0, #0x80000005\n"
                "MOVEQ   R0, #2\n"
                "BEQ     loc_FFC44F84\n"
                "CMP     R0, #0x80000007\n"
                "STRNE   R6, [R5,#0x54]\n"
                "BNE     loc_FFC44F88\n"
                "MOV     R0, #3\n"
"loc_FFC44F84:\n"
                "STR     R0, [R5,#0x54]\n"
"loc_FFC44F88:\n"
                "LDR     R0, =0x193D8\n"
                "LDR     R0, [R0,#8]\n"
                "CMP     R0, #0\n"
                "BEQ     loc_FFC44FA0\n"
                "BL      sub_FFC31B08\n"
                "B       loc_FFC44FA4\n"
"loc_FFC44FA0:\n"
                "BL      sub_FFC449F4\n"
"loc_FFC44FA4:\n"
                "MOV     R0, #5\n"
                "STR     R0, [R5,#0x38]\n"
"loc_FFC44FAC:\n"
                "ADD     SP, SP, #0x40\n"
                "LDMFD   SP!, {R4-R8,PC}\n"
"loc_FFC44FB4:\n"
                "LDR     LR, [SP,#0x58-0x28]\n"
                "CMP     LR, #0\n"
                "BEQ     loc_FFC4507C\n"
                "STR     R7, [R5,#0x2C]\n"
                "LDR     R0, [R5,#0x6C]\n"
                "LDR     R1, [R4,#0x14]\n"
                "LDR     R2, [R4,#0x18]\n"
                "LDR     R12, [R4,#0xC]\n"
                "ADD     R3, SP, #0x58-0x20\n"
                "ADD     R8, SP, #0x58-0x44\n"
                "STMIA   R8, {R0-R3}\n"
                "LDR     R3, [R5,#0x58]\n"
                "ADD     R2, SP, #0x58-0x1C\n"
                "ADD     R8, SP, #0x58-0x50\n"
                //"LDRD    R0, [SP,#0x58-0x30]\n"
				".long   0xE1CD02D8\n"
                "STMIA   R8, {R0,R2,R3}\n"
                "STR     R1, [SP,#0x58-0x54]\n"
                "STR     LR, [SP,#0x58-0x58]\n"
                "LDMIB   R4, {R0,R1}\n"
                "LDR     R3, [SP,#0x58-0x24]\n"
                "MOV     R2, R12\n"
                "BL      sub_FFCC7D84\n"
                "LDR     R0, [R5,#0x10]\n"
                "MOV     R1, #0x3E8\n"
                "BL      sub_FFC0B774\n"
                "CMP     R0, #9\n"
                "BNE     loc_FFC45030\n"
                "BL      sub_FFD08FA4\n"
                "MOV     R0, #0x90000\n"
                "STR     R7, [R5,#0x38]\n"
                "B       loc_FFC45048\n"
"loc_FFC45030:\n"
                "LDR     R0, [SP,#0x58-0x20]\n"
                "CMP     R0, #0\n"
                "BEQ     loc_FFC45050\n"
                "BL      sub_FFD08FA4\n"
                "MOV     R0, #0xA0000\n"
                "STR     R7, [R5,#0x38]\n"
"loc_FFC45048:\n"
                "BL      sub_FFC5B804\n"
                "B       loc_FFC44FAC\n"
"loc_FFC45050:\n"
                "BL      sub_FFCC7E48\n"
                "LDR     R0, [SP,#0x58-0x24]\n"
                "LDR     R1, [SP,#0x58-0x1C]\n"
                "BL      sub_FFD08D4C\n"
                "LDR     R0, [R5,#0x4C]\n"
                "LDR     R1, =0x520C\n"
                "ADD     R0, R0, #1\n"
                "STR     R0, [R5,#0x4C]\n"
                "LDR     R0, [SP,#0x58-0x1C]\n"
                "MOV     R2, #0\n"
                "BL      sub_FFD06BDC_my\n"
"loc_FFC4507C:\n"
                "LDR     R0, [R5,#0x50]\n"
                "ADD     R0, R0, #1\n"
                "STR     R0, [R5,#0x50]\n"
                "LDR     R1, [R5,#0x78]\n"
                "MUL     R0, R1, R0\n"
                "LDR     R1, [R5,#0x74]\n"
                "BL      sub_FFE4FB10\n"
                "MOV     R4, R0\n"
                "BL      sub_FFD08FDC\n"
                "LDR     R1, [R5,#0x70]\n"
                "CMP     R1, R4\n"
                "BNE     loc_FFC450B8\n"
                "LDR     R0, [R5,#0x30]\n"
                "CMP     R0, #1\n"
                "BNE     loc_FFC450CC\n"
"loc_FFC450B8:\n"
                "LDR     R1, [R5,#0x84]\n"
                "MOV     R0, R4\n"
                //"BLX     R1\n"
				".long   0xE12FFF31\n"
                "STR     R4, [R5,#0x70]\n"
                "STR     R6, [R5,#0x30]\n"
"loc_FFC450CC:\n"
                "STR     R6, [R5,#0x2C]\n"
                "B       loc_FFC44FAC\n"
 );
} 


void __attribute__((naked,noinline)) sub_FFD06BDC_my(){ 
 asm volatile(
                "STMFD   SP!, {R4-R8,LR}\n"
                "LDR     R4, =0x83D4\n"
                "LDR     LR, [R4]\n"
                "LDR     R2, [R4,#8]\n"
                "CMP     LR, #0\n"
                "LDRNE   R3, [R4,#0xC]\n"
                "MOV     R5, R2\n"
                "CMPNE   R3, #1\n"
                "MOVEQ   R2, #0\n"
                "STREQ   R0, [R4]\n"
                "STREQ   R2, [R4,#0xC]\n"
                "BEQ     loc_FFD06CA8\n"
                "LDR     R3, [R4,#4]\n"
                //"LDR     R7, =0xFFE6BA00\n"
				"LDR     R7, =table\n"          // *
                "ADD     R12, R3, R3,LSL#1\n"
                "LDR     R3, [R7,R12,LSL#2]\n"
                "ADD     R6, R7, #0x30\n"
                "LDR     R8, [R6,R12,LSL#2]\n"
                "SUB     R3, LR, R3\n"
                "CMP     R3, #0\n"
                "SUB     LR, LR, R8\n"
                "BLE     loc_FFD06C64\n"
                "ADD     R12, R7, R12,LSL#2\n"
                "LDR     LR, [R12,#4]\n"
                "CMP     LR, R3\n"
                "ADDGE   R2, R2, #1\n"
                "BGE     loc_FFD06C58\n"
                "LDR     R12, [R12,#8]\n"
                "CMP     R12, R3\n"
                "ADDLT   R2, R2, #3\n"
                "ADDGE   R2, R2, #2\n"
"loc_FFD06C58:\n"
    //          "CMP     R2, #0x17\n"   // -
    //          "MOVGE   R2, #0x16\n"   // -
                "CMP     R2, #0x1A\n"   // +
                "MOVGE   R2, #0x19\n"   // +
                "B       loc_FFD06C98\n"
"loc_FFD06C64:\n"
                "CMP     LR, #0\n"
                "BGE     loc_FFD06C98\n"
                "ADD     R3, R6, R12,LSL#2\n"
                "LDR     R12, [R3,#4]\n"
                "CMP     R12, LR\n"
                "SUBLE   R2, R2, #1\n"
                "BLE     loc_FFD06C90\n"
                "LDR     R3, [R3,#8]\n"
                "CMP     R3, LR\n"
                "SUBGT   R2, R2, #3\n"
                "SUBLE   R2, R2, #2\n"
"loc_FFD06C90:\n"
                "CMP     R2, #0\n"
                "MOVLT   R2, #0\n"
"loc_FFD06C98:\n"
                "CMP     R2, R5\n"
                "STRNE   R2, [R4,#8]\n"
                "MOVNE   R2, #1\n"
                "STRNE   R2, [R4,#0xC]\n"
"loc_FFD06CA8:\n"
                //"LDR     R2, =0xFFE6B9A4\n"
				"LDR     R2, =CompressionRateTable\n"   // *
                "LDR     R3, [R4,#8]\n"
                "LDR     R2, [R2,R3,LSL#2]\n"
				
				"LDR     R3, =video_mode\n"      // +
                "LDR     R3, [R3]\n"             // +
                "LDR     R3, [R3]\n"             // +
                "CMP     R3, #1\n"               // +
                "LDREQ   R3, =video_quality\n"   // +     
                "LDREQ   R3, [R3]\n"             // +     
                "LDREQ   R2, [R3]\n"             // +  
				
                "STR     R2, [R1]\n"
                "STR     R0, [R4]\n"
				"BL      mute_on_zoom\n"     // +
                "LDMFD   SP!, {R4-R8,PC}\n"
 );
} 

#include "conf.h"

int *video_quality = &conf.video_quality;
int *video_mode    = &conf.video_mode;

long def_table[24]={0x2000, 0x38D, 0x788, 0x5800, 0x9C5, 0x14B8, 0x10000, 0x1C6A, 0x3C45, 0x8000, 0xE35, 0x1E23,
           0x1CCD, -0x2E1, -0x579, 0x4F33, -0x7EB, -0xF0C, 0xE666, -0x170A, -0x2BC6, 0x7333, -0xB85, -0x15E3};

long table[24];

void change_video_tables(int a, int b){
 int i;
 for (i=0;i<24;i++) table[i]=(def_table[i]*a)/b; 
}

long CompressionRateTable[]={0x60, 0x5D, 0x5A, 0x57, 0x54, 0x51, 0x4D, 0x48, 0x42, 0x3B, 0x32, 0x29, 0x22, 0x1D, 0x17, 0x14, 0x10, 0xE, 0xB, 9, 7, 6, 5, 4, 3, 2, 1};
